package com.example.mydefinedview1.practice

import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.util.AttributeSet
import android.view.View

/**
 *
 * @Author： LJH
 * @Time： 2022/6/29
 * @description：
 */
class SimpleCircle(context: Context,attr:AttributeSet?):View(context,attr) {

    private val paint = Paint()
    init {
        paint.color = Color.BLUE
        //修改为画线模式
        paint.style = Paint.Style.STROKE
        //线条宽度为 20 像素
        paint.strokeWidth = 10F
        //消除锯齿
        paint.isAntiAlias = true
    }

    override fun onDraw(canvas: Canvas?) {
        super.onDraw(canvas)

        canvas?.drawRect(60F,100F,100F,30F,paint)
    }
}